package main

import (
	"fmt"
	"encoding/json"
)
//tag json序列化时字段才会变成小写，否则大写
type stu struct{
	Name string `json:"name"`
	Age int `json:"age"`
	score float64 `json:"score"`
}
func main(){


	var stu1 stu 
	stu1.Name="jack"
	stu1.Age=100
	stu1.score=33.22

	jsonStr,err:=json.Marshal(stu1)
	if err!=nil{
		fmt.Println("json encode error")
	}

	//jsonStr1 := []rune{jsonStr}
	x:=string(jsonStr)
	fmt.Println(x)
}